﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using NerdDinner.Models;

namespace NerdDinner.Tests.Models
{
    [TestClass]
    public class DinnerTest
    {
        [TestMethod]
        public void IsHostedBy_Should_Return_True_When_Dinner_HostedBy_User()
        {
            // Arrange
            var dinner = new Dinner
                             {
                                 HostedBy = "ScottGu"
                             };

            // Act
            bool isHostedByScott = dinner.IsHostedBy("ScottGu");

            // Assert
            Assert.IsTrue(isHostedByScott);
        }

        [TestMethod]
        public void IsUserRegistered_Should_Return_True_When_User_RSVPs()
        {
            // Arrange
            var dinner = new Dinner();
            dinner.RSVPs.Add(new RSVP {AttendeeName = "Haacked"});

            // Act
            bool haackedIsRegistered = dinner.IsUserRegistered("Haacked");

            // Assert
            Assert.IsTrue(haackedIsRegistered);
        }
    }
}